package com.lzy.mall.order.service.impl;

import com.lzy.mall.order.annotation.LzyLog;
import com.lzy.mall.order.annotation.LzyRole;
import com.lzy.mall.order.entity.OmsOrderItem;
import com.lzy.mall.order.dao.OmsOrderItemDao;
import com.lzy.mall.order.service.OmsOrderItemService;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * 订单项信息(OmsOrderItem)表服务实现类
 *
 * @author lzy
 * @since 2021-08-25 11:22:39
 */
@Service
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
public class OmsOrderItemServiceImpl implements OmsOrderItemService {
    private final OmsOrderItemDao omsOrderItemDao;

    @Override
    @LzyLog("你好日志文件")
    @LzyRole("t3")
    public void hello(String name) {
        System.out.println("Hello:" + name);
    }

    @Override
    public void saveBatch(List<OmsOrderItem> orderItems) {
        omsOrderItemDao.insertBatch(orderItems);
    }

    @Override
    public List<OmsOrderItem> list() {
        return omsOrderItemDao.all();
    }

    @Override
    public void save(OmsOrderItem orderItem) {
        omsOrderItemDao.insertTemplate(orderItem,true);
    }
}
